package com.cdtye.itps.cms.controller.origindata;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cdtye.common.webcore.web.AjaxJson;
import com.cdtye.itps.cms.dao.origindata.vo.JcjcDetectC4IndexVo;
import com.cdtye.itps.cms.service.origindata.JcjcDetectC4IndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Api(tags="4c原始数据接口")
@Controller
@ResponseBody
@RequestMapping("/detect4cIndex")
public class JcjcDetectC4IndexController {

    @Autowired
    private JcjcDetectC4IndexService jcjcDetectC4IndexService;

    @ApiOperation(value = "根据detectJobId查询相关4cIndex所关联的区站信息")
    @PostMapping(value = "/getC4IndexSiteListByDetectJobId")
    public AjaxJson<List<Map<String,Object>>> getC4IndexSiteListByDetectJobId(@RequestBody JcjcDetectC4IndexVo vo){
        return AjaxJson.success(jcjcDetectC4IndexService.getC4IndexSiteListByDetectJobId(vo));
    }

    @ApiOperation(value = "根据detectJobId和siteId查询4cIndex所相关的支柱信息")
    @PostMapping(value = "/getC4IndexPillarListByDetectJobIdAndSiteId")
    public AjaxJson<List<Map<String,Object>>> getC4IndexPillarListByDetectJobIdAndSiteId(@RequestBody JcjcDetectC4IndexVo vo){
        return AjaxJson.success(jcjcDetectC4IndexService.getC4IndexPillarListByDetectJobIdAndSiteId(vo));
    }

    @ApiModelProperty(value = "4C检测数据详情页面区站和支柱查询")
    @PostMapping(value = "getC4DetailPillarInfo")
    public AjaxJson<IPage<Map<String,Object>>> getC4DetailPillarInfo(@RequestBody JcjcDetectC4IndexVo vo)
    {
        return AjaxJson.success(jcjcDetectC4IndexService.getC4DetailPillarInfo(vo));
    }

}
